package Compile.YUFA;


import javax.swing.tree.TreeCellRenderer;
import java.util.ArrayList;
import java.util.List;

/*
* 语法树节点类
* */
public class TreeNode {
    private String value;   // 节点值
    private List<TreeNode> children;    // 子节点

    /*
    * 构造函数
    * */
    public TreeNode(String value) {
        this.value = value;
        this.children = new ArrayList<>();
    }

    public String getValue() {
        return this.value;
    }

    public List<TreeNode> getChildren() {
        return this.children;
    }

    /*
    * 添加子节点
    * */
    public void addChild(TreeNode child) {
        this.children.add(child);
    }
}
